/*
 * GdiplusSampleApplication.h
 *
 *  Created on: 2010-12-8
 *      Author: try
 */

#ifndef GDIPLUSSAMPLEAPPLICATION_H_
#define GDIPLUSSAMPLEAPPLICATION_H_

#include "../SampleApplication.h"
#include "WorkPage.h"

using namespace S;
using namespace Ed;

class GdiplusSampleApplication: public SampleApplication {
  public:
    GdiplusSampleApplication(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
    virtual ~GdiplusSampleApplication();

    void init(HWND hwnd){
      if (!page) {
        page = new WorkPage(hwnd);
      }
    }

  protected:
    LRESULT wndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  protected:
    virtual void onPaint();
    virtual void onMouseMove(int x, int y, unsigned int buttonsStatus);
    virtual void onMouseLeftPress(int x, int y, unsigned int buttonsStatus);
    virtual void onMouseLeftRelease(int x, int y, unsigned int buttonsStatus);
    virtual void onMouseLeftDoubleClick(int x, int y, unsigned int buttonsStatus);
    virtual void onMouseRightPress(int x, int y, unsigned int buttonsStatus);
    virtual void onMouseRightRelease(int x, int y, unsigned int buttonsStatus);
    virtual void onMouseWheelEvent(int x, int y, int zDelta, unsigned int buttonsStatus);
    virtual bool onSetCursor();
    virtual void onKeyPress(int key);
    virtual void onKeyRelease(int key);
  private:
    WorkPage* page;
};

#endif /* GDIPLUSSAMPLEAPPLICATION_H_ */
